Skip to content

fix: raise correct deprecation when config key is top-level in generic test (#12572)#12618

Open
kalluripradeep wants to merge 3 commits intodbt-labs:mainfrom
kalluripradeep:fix-missing-args-deprecation-misleading-12572
Open

fix: raise correct deprecation when config key is top-level in generic test (#12572)#12618
kalluripradeep wants to merge 3 commits intodbt-labs:mainfrom
kalluripradeep:fix-missing-args-deprecation-misleading-12572

Conversation

@kalluripradeep
Copy link
Contributor

Problem

Fixes #12572
Parent: #12394

When a user defines a config property like where at the top level of a generic test:

data_tests:
  - unique:
      where: "valid_to is null"

dbt was raising MissingArgumentsPropertyInGenericTestDeprecation, which misleads the developer into moving where under arguments: — which is wrong. The correct fix is to move it under config:.

Root Cause

In TestBuilder.extract_test_args(), the check for missing arguments property did not distinguish between actual test arguments and known config properties (CONFIG_ARGS like where, severity, tags, etc.). Any top-level key that wasn't config, column_name, description, or name triggered the wrong deprecation.

Fix

  1. Exclude CONFIG_ARGS from the missing-arguments check in extract_test_args() so that known config properties don't trigger MissingArgumentsPropertyInGenericTestDeprecation

  2. Emit PropertyMovedToConfigDeprecation for each CONFIG_ARGS key found at the root level of the test definition, guiding the developer to move it under config:

Test

Added TestMissingArgsVsPropertyMovedToConfig in tests/functional/deprecations/test_deprecations.py which verifies:

  • PropertyMovedToConfigDeprecation fires for where at top level
  • MissingArgumentsPropertyInGenericTestDeprecation does NOT fire

cc @dbeatty10

@kalluripradeep kalluripradeep requested a review from a team as a code owner March 8, 2026 16:32
@cla-bot cla-bot bot added the cla:yes label Mar 8, 2026
@github-actions github-actions bot added the community This PR is from a community member label Mar 8, 2026
@graciegoheen graciegoheen added the ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering label Mar 9, 2026
Copy link
Contributor

@ash2shukla ash2shukla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this work !
Please address following comments and we can merge it !

@kalluripradeep kalluripradeep force-pushed the fix-missing-args-deprecation-misleading-12572 branch from 8139492 to 0ab062b Compare March 18, 2026 14:55
@kalluripradeep
Copy link
Contributor Author

Thanks for the review @ash2shukla! Made all three changes — simplified the config key detection, removed the unnecessary profile target fixture, and updated the assertion to == 1. Please take another look!

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.36%. Comparing base (d3370c4) to head (0ab062b).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12618      +/-   ##
==========================================
- Coverage   91.38%   91.36%   -0.02%     
==========================================
  Files         203      203              
  Lines       25627    25707      +80     
==========================================
+ Hits        23419    23487      +68     
- Misses       2208     2220      +12     
Flag Coverage Δ
integration 88.14% <100.00%> (-0.10%) ⬇️
unit 65.35% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Unit Tests 65.35% <0.00%> (-0.02%) ⬇️
Integration Tests 88.14% <100.00%> (-0.10%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ash2shukla
Copy link
Contributor

@kalluripradeep Thanks for making the changes ! Looks like there are some formatting issues. Please make sure you run pre-commit before committing the changes. :)

@kalluripradeep
Copy link
Contributor Author

@kalluripradeep Thanks for making the changes ! Looks like there are some formatting issues. Please make sure you run pre-commit before committing the changes. :)

this should work now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla:yes community This PR is from a community member ready_for_review Externally contributed PR has functional approval, ready for code review from Core engineering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] MissingArgumentsPropertyInGenericTestDeprecation misleading on properties.

3 participants